﻿<h1>Go 101</h1>

	<p>
	<i>Go 101</i> is a book focusing on Go syntax/semantics
	and all kinds of details (Go 1.13 ready).
	This book also tries to help gophers gain a deep and thorough understanding of Go.
	It is expected that this book is helpful for both beginner and experienced Go programmers.
	</p>
	<ul>
	<!--
	<li>
	The book is maintained by <a href="https://twitter.com/TapirLiu">@TapirLiu</a>.
	</li>
	-->
	<li>
	The <a href="https://go101.org">go101.org</a> website is hosted on
	<a href="https://cloud.google.com/appengine/docs/standard/go/">App Engine</a>.
	Surely, it is built with <a href="https://golang.org">Go</a>.
	</li>
	<li>
	中文版在<a href="https://gfw.go101.org">这里</a>。
	</li>
	<li>
	The Go 101 project is hosted on both <a href="https://gitlab.com/go101/go101">Gitlab</a>
	and <a href="https://github.com/go101/go101">Github</a>.
	You can clone the code, then run <code>go run .</code> from the project path
	to start a local go101 server for faster browsing.
	</li>
	<li>
	Go 101's official twitter account is <a href="https://twitter.com/go100and1">@go100and1</a>.
	Some Go details, facts, and quizzes were (and will be) posted there from time to time.
	</li>
	</ul>




<div class="alert alert-success row item-row">
	<div class="col-xs-12 col-sm-3 text-center" style="font-size: small;">
		<img src="res/101-front-cover-1400x.jpg" style="width: 140px;" alt="the book"></img>
		<br/>(about 500 pages)
	</div>
	<div class="col-xs-12 col-sm-9" style="padding-top: 6px;"><small>
		The digital versions of this book are available at the following places:
		<ul>
		<li>
			<a href="https://leanpub.com/go101">Leanpub store</a>,
			<i>$19.99+</i>, Leanpub gets 20%, Tapir gets 80%.
		</li>
		<li>
			<a href="https://books.apple.com/us/book/id1459984231">Apple Books store</a>,
			<i>$19.99</i>, Apple gets 30%, Tapir gets 70%.
		</li>
		<li>
			<a href="https://www.amazon.com/dp/B07Q3HWZ98">Amazon Kindle store</a>,
			<i>$39.99</i>, Amazon gets 65%, Tapir gets 35%.
		</li>
		
		<li>
			<a href="https://github.com/go101/go101/releases">Free ebooks</a>,
			including pdf, epub and azw3 formats.
		</li>
		</ul>
		
		Tapir, the author of Go 101, has spent 3+ years on writing the Go 101 book
		and maintaining the go101.org website.
		New contents will continue being added to the book and the website from time to time.
		If you would like to, you can support the book and the website by
		making a donation through Paypal (<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PJWNSMCJ8XLX8&source=url">$5</a>, <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EK54M5NSXVFLL&source=url">$9</a>, <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z7NNPZN28Z6FL&source=url">$15</a>, or <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3VLHQW5VAVCUY&source=url">$25</a>) or buying Tapir a coffee (<a href="https://ko-fi.com/go_101" target="_blank">way 1</a> and <a href="https://www.buymeacoffee.com/go101" target="_blank">way 2</a>).

	</small></div>
</div>



<div class="alert alert-warning"><small>
	<i>2019/Oct/30</i>: 
	<ul>
	<li>
	<a href="https://github.com/go101/go101/commit/35b8f5e2aa7440c25bf0a784b5bde506d4ec3a65#diff-8eb02937949dd308587a57ed66732712">fixed a bug</a> in the "deleting subslice" example.
	</li>
	<li>
	<a href="https://github.com/go101/go101/commit/8b62837d3c957f45664679a622872d292806f76a#diff-e68191d52283c7638734b55744e083cf">corrected the explanation</a> for "The Evaluation Moment of Deferred Function Values".
	</li>
	<li>
	The article "The Right Places to Call the Built-in <code>recover</code> Function" is renamed to <a href="panic-and-recover-more.html">Explain Panic/Recover Mechanism in Detail</a>. It is almost wholly re-written.
	</li>
	</ul>
	
</small></div>

<div class="alert alert-warning"><small>
	<i>2019/Oct/18</i>: <a href="https://github.com/golang/go/issues/27821#issuecomment-543611217">An explanation description flaw</a> is found in the
	<a href="evaluation-orders.html#value-assignment">Evaluation and Assignment Orders in Assignment Statements</a> section
	in the "Expression Evaluation Orders" article.
	A simpler description is provoded now.
</small></div>

<div class="alert alert-warning"><small>
	<i>2019/Sep/30</i>: <a href="unsafe.html#fact-value-address-might-change">A new fact</a> is added to the "Type-Unsafe Pointers" article
	<strike>and a serious mistake was found in the
	<a href="unsafe.html#pattern-convert-to-uintptr-and-back">pattern 3: convert unsafe pointer to uintptr,
	do arithmetic operations with the uintptr value, then convert it back</a> section</strike>.
	(<i>I decided to withdraw this erratum.</i>)
</small></div>

<!--
<div class="alert alert-warning"><small>
	<i>2019/Sep/25</i>: The book made <a href="panic-and-recover-more.html#recover-order">a stupid mistake</a>
	in the "The Right Places to Call the recover Function" article. The section containing the mistake will be modified after some time.
</small></div>

<div class="alert alert-warning"><small>
	<i>2019/Sep/19</i>: The "named type" and "unnamed type" terminologies are added back in this book.
	But they are eqivalent to "defined type" and "non-defined type" now.
</small></div>

<div class="alert alert-warning"><small>
	NOTE: if your last <code>go get -u</code> command run was at before <b><i>July 28th, 2018</i></b>,
	please run this command again to install the latest <code>go101</code> program and articles.
</small></div>

<div class="alert alert-info"><small>
	<i>2019/Apr/09</i>: This book removed the "alias type", "named type" and "unnamed type" terminologies.
	"Type alias" is still used.
</small></div>

<div class="alert alert-info"><small>
	<i>2018/Dec/27</i>: A serious mistake was just fixed in this book.
	Before, the book said the starting index in a subslice syntax
	can't be larger than the length of the base slice.
	This is wrong. This restriction never exists.
	Please read <a href="container.html#subslice">the corrected section</a> again for details.
</small></div>

<div class="alert alert-info"><small>
	<i>2019/Jan/15</i>: The example for <a href="channel-use-cases.html#rate-limiting">rate-limit</a>
	was not correctly implemented before. Now it is fixed.
</small></div>
-->

<div>
Index:

<!-- index starts (don't remove) -->

<div id="book-index">

<!-- kindle starts: 1 -->

<ul class="index part">
	<li><a class="index" href="101-about.html">About Go 101</a> - why this book is written.</li>
	<li><a class="index" href="acknowledgements.html">Acknowledgements</a></li>
</ul>

<ul class="index part">
	<li><a class="index" href="introduction.html">An Introduction of Go</a> - why Go is worth learning.</li>
	<li><a class="index" href="go-sdk.html">The Official Go SDK</a> - how to compile and run Go programs.</li>
</ul>

<ul class="index part">
<li>
Become Familiar With Go Code

	<ul class="index chapters">
	<li><a class="index" href="basic-code-elements-introduction.html">Introduction of Source Code Elements</a></li>
	<li><a class="index" href="keywords-and-identifiers.html">Keywords and Identifiers</a></li>
	<li><a class="index" href="basic-types-and-value-literals.html">Basic Types and Their Value Literals</a></li>
	<li><a class="index" href="constants-and-variables.html">Constants and Variables</a> - also introduces untyped values and type deductions.</li>
	<li><a class="index" href="operators.html">Common Operators</a> - more type deduction rules are introduced.</li>
	<li><a class="index" href="function-declarations-and-calls.html">Function Declarations and Calls</a></li>
	<li><a class="index" href="packages-and-imports.html">Code Packages and Package Imports</a></li>
	<li><a class="index" href="expressions-and-statements.html">Expressions, Statements and Simple Statements</a></li>
	<li><a class="index" href="control-flows.html">Basic Control Flows</a></li>
	<li><a class="index" href="control-flows-more.html">Goroutines, Deferred Function Calls and Panic/Recover</a></li>
	</ul>

</li>
</ul>

<ul class="index part">
<li>
Go Type System

	<ul class="index chapters">
	<li><a class="index" href="type-system-overview.html">Overview of Go Type System</a> - a must read to master Go programming.</li>
	<li><a class="index" href="pointer.html">Pointers</a></li>
	<li><a class="index" href="struct.html">Structs</a></li>
	<li><a class="index" href="value-part.html">Value Parts</a> - to gain a deeper understanding into Go values.</li>
	<li><a class="index" href="container.html">Arrays, Slices and Maps</a> - first-class citizen container types.</li>
	<li><a class="index" href="string.html">Strings</a></li>
	<li><a class="index" href="function.html">Functions</a> - variadic functions, function types and values.</li>
	<li><a class="index" href="channel.html">Channels</a> - the Go way to do concurrency synchronizations.</li>
	<li><a class="index" href="method.html">Methods</a></li>
	<li><a class="index" href="interface.html">Interfaces</a> - value boxes used to do reflection and polymorphism.</li>
	<li><a class="index" href="type-embedding.html">Type Embedding</a> - type extension in the Go way.</li>
	<li><a class="index" href="unsafe.html">Type-Unsafe Pointers</a></li>
	<li><a class="index" href="generic.html">Built-in Generics</a></li>
	<li><a class="index" href="reflection.html">Reflections</a> - the <code>reflect</code> standard package.</li>
	</ul>
</li>
</ul>

<!-- kindle ends: 1 -->

<!-- kindle starts: 2 -->

<ul class="index part">
<li>
Some Special Topics

	<ul class="index chapters">
	<li><a class="index" href="line-break-rules.html">Line Break Rules</a></li>
	<li><a class="index" href="defer-more.html">More About Deferred Function Calls</a></li>
	<li><a class="index" href="panic-and-recover-use-cases.html">Some Panic/Recover Use Cases</a></li>
	<li><a class="index" href="panic-and-recover-more.html">Explain Panic/Recover Mechanism in Detail</a> - also explains exiting phases of function calls</li>
	<li><a class="index" href="blocks-and-scopes.html">Code Blocks and Identifier Scopes</a></li>
	<li><a class="index" href="evaluation-orders.html">Expression Evaluation Orders</a></li>
	<li><a class="index" href="value-copy-cost.html">Value Copy Costs in Go</a></li>
	<li><a class="index" href="bounds-check-elimination.html">Bounds Check Elimination</a></li>
	</ul>

</li>
</ul>

<ul class="index part">
<li>
Concurrent Programming

	<ul class="index chapters">
	<li><a class="index" href="concurrent-synchronization-overview.html">Concurrency Synchronization Overview</a></li>
	<li><a class="index" href="channel-use-cases.html">Channel Use Cases</a></li>
	<li><a class="index" href="channel-closing.html">How to Gracefully Close Channels</a></li>
	<li><a class="index" href="concurrent-synchronization-more.html">Other Concurrency Synchronization Techniques</a> - the <code>sync</code> standard package.</li>
	<li><a class="index" href="concurrent-atomic-operation.html">Atomic Operations</a> - the <code>sync/atomic</code> standard package.</li>
	<li><a class="index" href="memory-model.html">Memory Order Guarantees in Go</a></li>
	<li><a class="index" href="concurrent-common-mistakes.html">Common Concurrent Programming Mistakes</a></li>
	</ul>

</li>
</ul>


<ul class="index part">
<li>
Memory Relateds

	<ul class="index chapters">
	<li><a class="index" href="memory-block.html">Memory Blocks</a></li>
	<li><a class="index" href="memory-layout.html">Memory Layouts</a></li>
	<li><a class="index" href="memory-leaking.html">Memory Leaking Scenarios</a></li>
	</ul>

</li>
</ul>

<ul class="index part">
<li>
Some Summaries

	<ul class="index chapters">
	<li><a class="index" href="summaries.html">Some Simple Summaries</a></li>
	<li><a class="index" href="nil.html"><code>nil</code> in Go</a></li>
	<li><a class="index" href="value-conversions-assignments-and-comparisons.html">Value Conversion, Assignment and Comparison Rules</a></li>
	<li><a class="index" href="exceptions.html">Syntax/Semantics Exceptions</a></li>
	<!-- (to remove) for printing
	<li><a class="index" href="details.html">Go Details 101</a></li>
	<li><a class="index" href="unofficial-faq.html">Go FAQ 101</a></li>
	<li><a class="index" href="tips.html">Go Tips 101</a></li>
	(to remove) -->
	</ul>

</li>
</ul>

<!-- kindle ends: 2 -->

<!-- kindle starts: 0 -->

<ul class="index part">
<li><a class="index" href="more.html">More Go Related Topics</a></li>
</ul>

<!-- kindle ends: 0 -->

</div>

<!-- index ends (don't remove) -->

</div>
